package com.estock.common.model.security.enums;


public enum StockStatus {
	ACTIVE(1, "Active"), INACTIVE(2, "Inactive");
	
	private int status;
	private String desc;
	
	StockStatus(int status, String desc) {
		this.status = status;
		this.desc = desc;
	}
	
	public int getStatus() {
		return status;
	}

	public String getDesc() {
		return desc;
	}

	public static String getDescByStatus(int status) {
		if (StockStatus.ACTIVE.status == status) {
			return StockStatus.ACTIVE.desc;
		} else if (StockStatus.INACTIVE.status == status) {
			return StockStatus.INACTIVE.desc;
		}
		throw new RuntimeException("Unsupported stock type.");
	}
}
